In a multiprocessor system, data integrity is always of key concern. For instance, in multiprocessing systems employing a plurality of sub-processing units, the sub-processing units typically have no cache system (memory storage space apart from main memory such as random access memory (RAM)) Thus, because such subprocessors may share common data, synchronization between and among processors is required in order to ensure coherency of shared data.
Traditional approaches to achieving such synchronization have involved the use of a synchronization variable to serve as a “barrier object,” in an object oriented software program, to control read and write access to shared data. For instance, a typical barrier object that prevents access to shared memory when necessary can be created in software by a processor which can initialize a synchronization procedure by creating a barrier object. For example, in connection with a continuous loop of a main program running in a multiprocessor system, indexed data, is written to a memory or buffer area shared for use by the processors. Pseudo code for implementing a barrier procedure is as follows:
Initialization of synchronization: create barrier object (objB)
Main loop:                Wait on objB        Create data Dm         Write Dm to shared aream=m+1        
The barrier object objB includes a variable which permits or denies access to the memory area shared by the processors such that after creation of the barrier object, the main processor or subprocessor units must wait until the barrier object is available before the data in the shared memory can be read from or written to.
A buffer can be created by each processor in conjunction with a request for the barrier object objB, in which data is placed pursuant to a READ of the shared memory area or pursuant to a WRITE to the shared memory area. Pseudo code for this request procedure also involving the buffer object is as follows:
Synchronization initialization:                get barrier object (objB)        create buffer to get data (buf)        wait on objB        
A processor requesting data in accordance with this procedure must therefore wait until the variable associated with objB becomes available, indicating that the memory in the shared area is available for reading or writing. Once the barrier object is received by a requesting processor for a READ of the shared data, data from the shared memory can be placed in a buffer corresponding to locations in the shared memory. Pseudo code for this procedure could be as follows:
Main loop:                Wait on objB        
Sub loop:                get place of data . . . i        get Dmi to buf and calculate loop while (i<num)        
Alternatively, should the variable indicate the objB is available and additionally that the shared memory is available for a WRITE, data in a buffer is placed into corresponding locations in the shared memory.
As noted, the individual processing elements of such a multi-processor system must wait on the barrier object in order to synchronize to one another. The processing element that creates the shared data also waits on the barrier object during the writing of such data to shared memory. Finally, the processing elements seeking to read the shared data from memory also wait on the barrier object during the reading process.
The efficacy of this traditional approach of using a synchronization variable in the multi-processor environment is typically a function of the diligence of the software programmer in coding the interrelationships between processing elements created by the barrier object. As it is a relatively complex and difficult task to ensure that the software code accurately reflects the barrier object interrelationships, programming errors often occur. This problem is exacerbated because it is difficult to debug software programs that contain coding errors associated with synchronization variables. Further, barriers provided by software generally require a great deal of customization. Accordingly, improved synchronization methods and systems are needed.